<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title><%= title %></title>
    <script type="text/javascript" src="/javascript/lib/QRcode/qrcode.js"></script>
    <style type="text/css">
        div{
            margin: 10px;
        }
    </style>
</head>
<body>
<div>
    <%= title %>
    <hr>
    <div id="qrcode"></div>
    <hr>
    <div id="test"></div>
    <input type="button" id="QR-clear" value="清除">
    <input type="button" id="QR-create" value="创建">
    <hr>
    <script type="text/javascript">
        window.onload = function () {
            new QRCode(document.getElementById("qrcode"), "http://jindo.dev.naver.com/collie");

            var qrcode = new QRCode("test", {
                text: "<div style=\"font-size: 40px\">byjs</div>",
                width: 128,
                height: 128,
                colorDark : "#000",
                colorLight : "#fff",
                correctLevel : QRCode.CorrectLevel.H
            });
            document.getElementById('QR-clear').onclick = function() {
                qrcode.clear();
                console.log('清空二维码',QRCode.CorrectLevel.H)
            }
            //qrcode.makeCode("http://naver.com");

            document.getElementById('QR-create').onclick = function() {
                qrcode.makeCode("http://naver.com");
                console.log('清空二维码',QRCode.CorrectLevel.H)
            }

        }

    </script>
</div>
</body>
</html>